<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改广告合同')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: summernote-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-advertcontract-edit" th:object="${jiaqinAdvertContract}">
            <input name="id" th:field="*{id}" type="hidden">
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">合作类型ID：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="cooperateId" th:field="*{cooperateId}" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
            <div class="form-group">
                <label class="col-sm-3 control-label">广告类型：</label>
                <div class="col-sm-8">
                    <input name="cooperateName" th:field="*{cooperateName}" class="form-control" type="text" readonly="readonly">
                </div>
            </div>
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">用户ID：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="memberId" th:field="*{memberId}" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
            <div class="form-group">    
                <label class="col-sm-3 control-label">用户名：</label>
                <div class="col-sm-8">
                    <input name="memberName" th:field="*{memberName}" class="form-control" type="text" readonly="readonly">
                </div>
            </div>
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">用户类型：0-普通 1-企业 2-其他：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <select name="memberType" class="form-control m-b">-->
<!--                        <option value="">所有</option>-->
<!--                    </select>-->
<!--                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">企业名：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="companyName" th:field="*{companyName}" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
            <div class="form-group">    
                <label class="col-sm-3 control-label">合同标题：</label>
                <div class="col-sm-8">
                    <input name="title" th:field="*{title}" class="form-control" type="text">
                </div>
            </div>
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">类型：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <select name="type" class="form-control m-b">-->
<!--                        <option value="">所有</option>-->
<!--                    </select>-->
<!--                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>-->
<!--                </div>-->
<!--            </div>-->
            <div class="form-group">    
                <label class="col-sm-3 control-label">价格：</label>
                <div class="col-sm-8">
                    <input name="price" th:field="*{price}" class="form-control" type="text" readonly="readonly">
                </div>
            </div>
            <div class="form-group">    
<!--                <label class="col-sm-3 control-label">合同内容：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="content" th:field="*{content}" class="form-control" type="text">-->
<!--                </div>-->
                <input id="content" name="content" type="hidden" th:field="*{content}">
                <label class="col-sm-3 control-label">合同内容：</label>
                <div class="col-sm-8">

                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <button id="edit" class="btn btn-primary btn-xs m-l-sm" onclick="editDetails()" type="button">编辑</button>
                            <button id="save" class="btn btn-primary  btn-xs" onclick="saveDetails()" type="button">保存</button>
                        </div>
                        <div class="ibox-content" id="eg">

                            <div class="click2edit wrapper">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">状态：0-未付款 1-已付款：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <div class="radio-box">-->
<!--                        <input type="radio" name="status" value="">-->
<!--                        <label th:for="status" th:text="未知"></label>-->
<!--                    </div>-->
<!--                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">支付单编号：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="outTradeNo" th:field="*{outTradeNo}" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">相关资源ID：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="resId" th:field="*{resId}" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">是否同意合同：0-否 1-是：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="isAgree" th:field="*{isAgree}" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">创建时间：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <div class="input-group date">-->
<!--                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>-->
<!--                        <input name="createdTime" th:value="${#dates.format(jiaqinAdvertContract.createdTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">-->
<!--                    </div>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">修改时间：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <div class="input-group date">-->
<!--                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>-->
<!--                        <input name="updatedTime" th:value="${#dates.format(jiaqinAdvertContract.updatedTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">-->
<!--                    </div>-->
<!--                </div>-->
<!--            </div>-->
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <th:block th:include="include :: summernote-js" />
    <script type="text/javascript">
        var prefix = ctx + "jiaqin/advertcontract";
        $("#form-advertcontract-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-advertcontract-edit').serialize());
            }
        }

        $("input[name='createdTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='updatedTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $(document).ready(function () {
            $('.summernote').summernote({
                lang: 'zh-CN'
            });
        });
        var content = $("#content").val();
        $('.click2edit').summernote('code', content);
        $('.click2edit').summernote('destroy');
        var editDetails = function () {
            $("#eg").addClass("no-padding");
            $('.click2edit').summernote({
                lang: 'zh-CN',
                focus: true
            });
        };
        var saveDetails = function () {
            $("#eg").removeClass("no-padding");
            var aHTML = $('.click2edit').summernote('code');
            $('.click2edit').summernote('destroy');
            $("#content").val(aHTML)
        };
    </script>
</body>
</html>